#include<bits/stdc++.h>
using namespace std;
#define ls p[u].c0
#define rs p[u].c1
#define ms p[u].c2
#define col p[u].col
#define fat p[u].fat
mt19937 rnd(time(0));
int n,l,lmax=0,lmin=0;
char s[1000005],res[105][105];
int cid[305],x[3][3]={
	{0,1,-1},
	{-1,0,1},
	{1,-1,0} 
};
int main(){
	freopen("snake.in","r",stdin);
	freopen("snake.out","w",stdout);
	cid['R']=0;cid['G']=1;cid['B']=2;
	scanf("%s",s+1);n=strlen(s+1);
	for(int i=2;i<=n;i++){
		l+=x[cid[s[i-1]]][cid[s[i]]];
		lmax=max(lmax,l);lmin=min(lmin,l);
	}
	printf("%d %d\n",2,lmin+lmax+1);
	res[1][lmin+1]=res[2][lmin+1]=s[1];
	for(int i=lmin;i>=1;i--)
		if(res[1][i+1]=='R')res[1][i]=res[2][i]='B';
		else if(res[1][i+1]=='G')res[1][i]=res[2][i]='R';
		else res[1][i]=res[2][i]='G';
	for(int i=lmin+2;i<=lmin+lmax+1;i++)
		if(res[1][i-1]=='R')res[1][i]=res[2][i]='G';
		else if(res[1][i-1]=='G')res[1][i]=res[2][i]='B';
		else res[1][i]=res[2][i]='R';
	for(int i=1;i<=2;i++){
		for(int j=1;j<=lmin+lmax+1;j++)putchar(res[i][j]);
		puts("");
	}
	printf("%d %d\n",1,lmin+1);
	int u=1;
	for(int i=2;i<=n;i++){
		int op=x[cid[s[i-1]]][cid[s[i]]];
		if(op==1)putchar('R');
		else if(op==-1)putchar('L');
		else{
			if(u==1)putchar('D'),u=2;
			else putchar('U'),u=1;
		}
	}
	puts("");
	return 0;
} 
